package com.qiangesoft.voice2text.constant;

import java.util.regex.Pattern;

/**
 * 阿里云常量
 *
 * @author qiangesoft
 * @date 2024-04-11
 */
public class AliyunConstant {

    /**
     * 常量，固定值
     */
    public static final String API_VERSION = "2018-08-17";
    public static final String POST_REQUEST_ACTION = "SubmitTask";
    public static final String GET_REQUEST_ACTION = "GetTaskResult";

    /**
     * 请求参数
     */
    public static final String KEY_APP_KEY = "appkey";
    public static final String KEY_FILE_LINK = "file_link";
    public static final String KEY_VERSION = "version";
    public static final String KEY_ENABLE_WORDS = "enable_words";

    /**
     * 响应参数
     */
    public static final String KEY_TASK = "Task";
    public static final String KEY_TASK_ID = "TaskId";
    public static final String KEY_STATUS_TEXT = "StatusText";
    public static final String KEY_RESULT = "Result";
    public static final String KEY_WORDS = "Words";

    /**
     * 状态值
     */
    public static final String STATUS_SUCCESS = "SUCCESS";
    public static final String STATUS_RUNNING = "RUNNING";
    public static final String STATUS_QUEUEING = "QUEUEING";

    /**
     * 以4开头的状态码是客户端错误
     */
    public static final Pattern PATTERN_CLIENT_ERR = Pattern.compile("4105[0-9]*");
    /**
     * 以5开头的状态码是服务端错误
     */
    public static final Pattern PATTERN_SERVER_ERR = Pattern.compile("5105[0-9]*");
}
